import React from 'react'
import '../Counter.css'
import PropTypes from 'prop-types'




class Counter extends React.Component{
  // constructor(props){
  //     super(props)
  //     this.state={value:this.props.value}
  //     console.log(this.props)
  // }
	render(){
 const {countAdd, countSub} = this.props;
		return (

		<div className="counter">
        		<input  className="show" disabled value={this.props.count}/>
        	<div>
          		<button className="add" onClick={countAdd}>+</button>
          		<button className="sub" onClick={countSub}>-</button>
        	</div>
      </div>

			)
	}

}
Counter.propTypes ={
  count:PropTypes.number.isRequired,
  countAdd:PropTypes.func.isRequired,
  countSub:PropTypes.func.isRequired
}
export  default Counter
